import './public/index'
import { base } from './data/url'

/* 焦点图 */
jackpot()
function jackpot() {
  let jackpot

  jackpot = new Swiper ('#focus-jackpot', {
    direction: 'vertical',
    onlyExternal: true,
    autoplayDisableOnInteraction: false,
    autoplay: 2000,
    loop: true
  })
}
/* /焦点图 */

/* 列表 */
list()
function list() {
  $(document).on('click', '.list-tabs-item', (e) => {
    e.preventDefault()

    let $el = $(e.target),
        $p  = $el.parents('.list'),
        $c  = $p.find('.list-contents-item')

    if (!($el.hasClass('list-tabs-item'))) {
      $el = $el.parents('.list-tabs-item')
    }

    $el
      .addClass('active')
      .siblings()
      .removeClass('active')

    $c
      .eq($el.index())
      .addClass('active')
      .siblings()
      .removeClass('active')

  })
}
/* /列表 */